package tuitionmanagement.DAO;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
import tuitionmanagement.entity.Account;
import java.util.ArrayList;

/**
 *
 * @author Admin
 */
public class Accountfee {

    private AccountDAO dao;
    private String lastError;

    public Accountfee() {
        dao = new AccountDAO();
    }

    /**
     * Read by all Accounts
     * @return
     */
    public ArrayList<Account> readByAll() {
        return dao.readByAll();
    }

    /**
     * New Account
     * @param account
     * @return boolean
     */
    public boolean create(Account account) {
        return dao.create(account);
    }

    /**
     * Update Account
     * @param account
     * @return boolean
     */
    public boolean store(Account account) {
        return dao.update(account);
    }

    public boolean authencicate(Account account) {
        return dao.authencicate(account);
    }

    /**
     * Remove Account
     * @param accountID
     * @return
     */
//<<<<<<< .mine
//    public boolean remove(int accId) {
//        return dao.delete(accId);
//=======
//    public boolean remove(int accID) {
//        return dao.delete(accID);
//>>>>>>> .r64
//    }

    /**
     * Change password for current account
     * @param acc
     * @param oldPass
     * @return boolean
     */
    public boolean changePass(Account acc, String oldPass) {
        return dao.changePass(acc, oldPass);
    }

    /**
     * @return the lastError
     */
    public String getLastError() {
        return dao.getLastError();
    }

    /**
     * @param lastError the lastError to set
     */
    public void setLastError(String lastError) {
        this.lastError = lastError;
    }
}
